home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / Developer University / DU Projects / TalkerLib C++ Source / main.cpp next >
Encoding:
C/C++ Source or Header  |  1996-08-22  |  1.0 KB  |  49 lines  |  [TEXT/CWIE]

  1. //    Dave Wilson
  2. //    2-13-96
  3. // CW 8
  4.  
  5. //==============================================
  6. #ifndef _TCOMPUTER_
  7.     #include "TComputer.h"
  8. #endif
  9.  
  10. #ifndef _TTALKER_
  11.     #include "TTalker.h"
  12. #endif
  13.  
  14. //==============================================
  15. void
  16. main()
  17. {
  18.     const Boolean kWait = TRUE;
  19.     if (!TComputer::HasTextToSpeech())
  20.         SysBeep(1);
  21. /*    
  22.     TTalker* bob = new TTalker();
  23.     bob->Faster(); 
  24.     bob->SayString("Hello There Jeanette", kWait);
  25.     bob->SayString("I'm a stand-alone application!", kWait);
  26.     delete bob;
  27.  
  28.     TTalker* kid = new TTalker();
  29.     kid->UseVoiceNamed("Junior");
  30.     float pi = 3.14159;
  31.     const short kNumberDigits = 2;
  32.     kid->Slower(); 
  33.     kid->SayFloat(pi, kNumberDigits, kWait);
  34.     delete kid;
  35. */    
  36.     TTalker* hal = new TTalker();
  37.     hal->Faster(); 
  38.     hal->Faster(); 
  39.     char* voiceName = "Princess";
  40.     for (short index = 0; index <= hal->GetNumberVoices(); index ++) {
  41.         hal->UseVoiceNamed(voiceName);
  42.         hal->UseVoice(index);
  43.         voiceName = hal->GetVoiceName(index);
  44.         hal->SayString(voiceName, kWait);
  45.         hal->SayInteger(index, kWait);
  46.         }
  47.     delete hal;
  48.  
  49. }